
import {
  Switch,
  Route,
} from "react-router-dom";
// 订单
import OrderIndex from "../components/order/index";
// 用户
import UsersIndex from "../components/users/index";
// 管理员
import AdminsIndex from "../components/admins/adminsInfo/index";
// 购物车
import CartsIndex from "../components/carts/index";


//   秒杀活动
//// 获取秒杀
import SeckillIndex from "../components/seckill/index";
//// 新增秒杀
import SecondSkillAdd from "../components/seckill/addSecondKill" 


// 类型
import TypeIndex from "../components/type/index";
// 新增类型
import TypeAdd from "../components/type/AddTypes";
// 父类型修改
import TypeReset from "../components/labels/index";
// 商品
import CommsIndex from "../components/comms/index";
// 新增商品
import CommsAdd from "../components/comms/addComm";
// 修改商品
import CommsReset from "../components/comms/resetComm";
// 商品图片
import CommsUpload from "../components/comms/upload"
// 自提点
import AddressIndex from "../components/address/index";

import Addshopping from "../components/carts/addshopping";
import Changeshopping from "../components/carts/change";
import AddressAdd from '../components/address/address_add';
import AddressAmend from '../components/address/amend';
import AddressPicture from '../components/address/picture'

// 管理员修改
import AdminsUpdata from "../components/admins/adminsUpdata/index";
// // 管理员新增
import AdminsAdd from "../components/admins/adminsAdd/index";

//eslint-disable-next-line
export default () => {
  return (
    <div style={{ flexGrow: 1 }}>
      {/* A <Switch> looks through its children <Route>s and
            renders the first one that matches the current URL. */}
      <Switch >
        {/* 订单 */}
        <Route exact path="/info/order">
          <OrderIndex />
        </Route>
        {/* 管理员 */}
        <Route exact path="/info/admins">
          <AdminsIndex />
        </Route>
        {/* 修改管理员信息 */}
        <Route path="/info/updata/:_id">
          <AdminsUpdata />
        </Route>
        {/* 新增管理员 */}
        <Route path="/info/add">
          <AdminsAdd />
        </Route>
        {/* 用户 */}
        <Route exact path="/info/users">
          <UsersIndex />
        </Route>
        {/* 类型 */}
        <Route exact path="/info/type">
          <TypeIndex />
        </Route>
        {/* 添加类型 */}
        <Route path="/info/type/addType">
          <TypeAdd />
        </Route>
        {/* 修改类型 */}
        <Route path="/info/type/reset/:_id">
          <TypeReset />
        </Route>
        {/* 购物车 */}
        <Route exact path="/info/carts">
          <CartsIndex />
        </Route>

          <Route path="/info/carts/addshopping">
            <Addshopping />
          </Route>

          <Route path="/info/carts/change/:_id">
            <Changeshopping />
          </Route>
        {/* 商品 */}
        <Route exact path="/info/comms">
          <CommsIndex />
        </Route>
        {/* 新增商品 */}
        <Route exact path="/info/comms/add">
          <CommsAdd />
        </Route>
        
        {/* 修改商品 */}
        <Route exact path="/info/comms/reset/:_id">
          <CommsReset />
        </Route>
        {/* 上传商品图片 */}
        <Route exact path="/info/comms/upload/:_id">
          <CommsUpload />
        </Route>
        {/* 秒杀活动*/}
        <Route exact path="/info/seckill">
          <SeckillIndex />
        </Route>
        {/*新增秒杀*/}
        <Route exact path="/info/seckill/add">
          <SecondSkillAdd />
        </Route>
        {/* 地址 */}
        {/* 驿站地址 */}
        <Route exact path="/info/address">
          <AddressIndex />
        </Route>
        {/* 驿站 */}
        <Route path="/info/address_add">
          <AddressAdd />
        </Route>
        {/* 驿站 */}
        <Route path='/info/address_amend/:_id'>
          <AddressAmend />
        </Route>
        {/* 驿站上传图片 */}
        <Route path='/info/address_picture/:_id'>
          <AddressPicture />
        </Route>
      </Switch>
    </div>
  )
}